Skip to main content
Version: Preview

Google Pub/Sub

Experimental
Creates:
AssetsLineage

Configure in the UI

This plugin can be configured directly in the Marmot UI with a step-by-step wizard.

View Guide

The Google Pub/Sub plugin discovers topics and subscriptions from a Google Cloud project. Topics carry their labels, message storage policy, retention and schema; a topic with an Avro schema also gets a column list built from the schema's top-level fields. Subscriptions carry their delivery type, acknowledgement settings, filter and dead letter policy.

Lineage runs from a topic to each of its subscriptions, from a subscription to its dead letter topic, and from a subscription to the system it exports to: the BigQuery table or the Cloud Storage bucket. Those destinations are owned by the BigQuery and Google Cloud Storage plugins, so only the edge is created. A topic that ingests from Amazon Kinesis is linked from the Kinesis stream.

Authentication

With neither credentials_file nor credentials_json set, Application Default Credentials are used, which covers Workload Identity, a Compute Engine service account and GOOGLE_APPLICATION_CREDENTIALS. The service account needs roles/pubsub.viewer. Without permission to read schemas, discovery logs a warning and continues without them.

Emulator

Set emulator_host to a host:port address to run against the Pub/Sub emulator. The connection then uses plaintext gRPC with no credentials, and assets get no Google Cloud console links.

Sample Messages

With include_sample_messages: true, asset previews read up to 20 messages for 5 seconds. A subscription is read directly; a topic borrows one of its pull subscriptions. Every message is nacked rather than acknowledged, so Pub/Sub redelivers it to the real consumer straight after.

Example Configuration


project_id: "company-streaming"
credentials_file: "/etc/marmot/pubsub-service-account.json"
include_subscriptions: true
include_schemas: true
include_dead_letter_topics: true
filter:
include:
- "^orders.*"
exclude:
- ".*-dlq$"
tags:
- "pubsub"
- "streaming"

Configuration

The following configuration options are available:

PropertyTypeRequiredDescription
credentials_filestringfalsePath to a service account JSON file
credentials_jsonstringfalseService account JSON content
emulator_hoststringfalseAddress of a Pub/Sub emulator, for example localhost:8085
external_links[]ExternalLinkfalseExternal links to show on all assets
filterFilterfalseFilter discovered assets by name (regex)
include_dead_letter_topicsboolfalseWhether to record dead letter topics on subscriptions
include_sample_messagesboolfalseWhether to allow reading sample messages for asset previews
include_schemasboolfalseWhether to attach topic schemas and their fields
include_subscriptionsboolfalseWhether to discover subscriptions
project_idstringtrueGoogle Cloud project ID
tagsTagsConfigfalseTags to apply to discovered assets

Available Metadata

The following metadata fields are available:

FieldTypeDescription
ack_deadline_secondsintSeconds a subscriber has to acknowledge a message
allowed_persistence_regions[]stringRegions the message storage policy allows
bigquery_statestringWhether the BigQuery export is working (ACTIVE when it is)
bigquery_tablestringBigQuery table messages are written to
bigquery_use_topic_schemaboolWhether the topic's schema is used to write the BigQuery rows
cloud_storage_bucketstringCloud Storage bucket messages are written to
cloud_storage_filename_prefixstringPrefix of the objects written to the bucket
cloud_storage_filename_suffixstringSuffix of the objects written to the bucket
cloud_storage_statestringWhether the Cloud Storage export is working (ACTIVE when it is)
column_namestringAvro field name
data_typestringAvro field type, unions joined with a pipe
dead_letter_topicstringId of the topic undeliverable messages are forwarded to
delivery_typestringHow messages are delivered (pull, push, bigquery, cloud_storage)
descriptionstringThe Avro field's doc string
detachedboolWhether the subscription is detached from its topic and no longer receives messages
enable_message_orderingboolWhether messages with the same ordering key are delivered in order
exactly_once_deliveryboolWhether exactly once delivery is enabled
expiration_ttlstringHow long the subscription can be inactive before it is deleted
filterstringExpression selecting which messages are delivered
ingestion_sourcestringExternal system Pub/Sub imports messages from (aws_kinesis, cloud_storage, azure_event_hubs, amazon_msk, confluent_cloud)
is_nullableboolWhether the field's union includes null
kms_key_namestringCloud KMS key protecting published messages
labelsmap[string]stringLabels set on the topic or subscription
max_delivery_attemptsintDeliveries attempted before a message goes to the dead letter topic
message_retentionstringHow long unacknowledged messages are kept
project_idstringGoogle Cloud project the resource belongs to
push_endpointstringURL messages are pushed to
retain_acked_messagesboolWhether acknowledged messages are kept for replay
retentionstringHow long published messages stay available to subscribers
schemastringId of the schema published messages are validated against
schema_encodingstringMessage encoding the schema is applied to (JSON, BINARY)
schema_revisionstringRevision id of the schema
schema_typestringSchema type (AVRO, PROTOCOL_BUFFER)
statestringTopic or subscription state
subscription_countintNumber of subscriptions attached to the topic
subscription_namestringFull resource name, projects/{project}/subscriptions/{subscription}
subscriptions[]stringIds of the subscriptions attached to the topic
topicstringId of the topic the subscription reads
topic_namestringFull resource name, projects/{project}/topics/{topic}
urlstringLink to the resource in the Google Cloud console